<template>
	<view>
		<view @click="go(item)" v-for="(item,index) in list" :key="index" class="u-padding-30 u-border-bottom">
			<view class="u-flex u-row-between $u-type-info">
				<view>订单ID：{{item.outTradeNo}}</view>
				<view v-if="item.carportName">{{item.carportName}}号车位</view>
			</view>
			<view style="margin: 20rpx 0;font-weight: bold;font-size: 32rpx;">
				{{item.nickname}} 
			</view>
			<view style="color: #666;margin-bottom: 20rpx;" class="u-flex u-row-between">
				<view >手机号:{{item.mobile?item.mobile:'暂无'}}</view>
				<view v-if="item.minute">使用时长:{{item.minute}}分钟</view>
				<view v-if="item.cardName">{{item.cardName}}</view>
			</view>
			<view class=" u-row-between" style="display: flex;">
				<view>服务时间：{{item.createTime}}</view>
				<view style="width: 200rpx;text-align: right;" v-if="item.orderType==1">
					<view class="u-font-26 ">
						实付：<text style="color: #FC1010;">￥{{item.balance}}</text>
					</view>
					<view class="u-type-info u-font-24  ">
						<text class="">优惠：￥{{item.saleMoney}}</text>
					</view>
				</view>
				<view style="width: 200rpx;text-align: right;" v-if="item.orderType==2">
					<view class="u-font-26 ">
						实付：<text style="color: #FC1010;">￥{{item.payMoney}}</text>
					</view>
				</view>
				<view style="width: 200rpx;text-align: right;" v-if="item.orderType==4">
					<view class="u-font-26 ">
						实付：<text style="color: #FC1010;">￥{{item.payMoney}}</text>
					</view>
				</view>
			</view>
			<!-- <view class="u-text-right u-margin-top-10">
				<view class="u-type-info u-font-24 ">
					<text class="u-margin-right-20">优惠：￥{{item.saleMoney}}</text>
					<text>应付：￥{{item.totalMoney}}</text>
				</view>
			</view> -->
			<view class="u-flex u-row-between u-margin-top-20"  v-if="item.orderType!==4" >
				<view style="color: #0064C6;" v-if="item.cn">车牌号：{{item.cn}}</view>
				<view @click.stop="end(item)"  :class="item.status!==1?'ed':'ing'" style="color: #fff;background: #;border-radius: 40rpx;padding: 7rpx 15rpx;text-align: center;">
					{{item.status!==1?' 已完成 ':'结束订单'}}
				</view>
			</view>
			
			<u-toast ref="uToast" />
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			 list:{
				 type:Array,
				 default: () => []

			 },
			 
		},
		data(){
			return{
				
			}
		},
		methods:{
			go(item){
				this.$emit('go',item)
			},
			end(item){
				if(item.status==2)return
			    this.$emit('end',item)
	
			}
		}
	}
</script>

<style>
	.ed{
		background: #FF9900;
	}
	.ing{
		background: #0064C6;
	}
</style>
